﻿using System;
using System.Collections.Generic;
using System.Text;
using Core.Model;
using Core.Parser.ASN1Parser.Nodes;

namespace Core.Parser.ASN1Parser.Builders
{
    internal class VideoBuilder
    {
        public static Video Build(TaggedNode node, Group group)
        {
            var video = new Video();
            VisibleBuilder.Build(node, video, group);

            TaggedNode e;

            if ( ( e = node[ASN1ContextCodes.C_COMPONENT_TAG]) != null)
                video.ComponentTag = e.First.IntValue;

            if ((e = node[ASN1ContextCodes.C_TERMINATION]) != null)
                video.Termination = e.First.BoolValue;

            return video;
        }
    }
}
